package com.example.demo;

import com.example.demo.redis.MyRedisTemplate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class DemoApplication {

  public static void main(String[] args) {
    ApplicationContext context = SpringApplication.run(DemoApplication.class, args);
    MyRedisTemplate redisTemplate = context.getBean(MyRedisTemplate.class);
    redisTemplate.set("cwy", "芜湖机长");
    System.out.println("从redis取得值是" + redisTemplate.get("cwy"));
    redisTemplate.setBit("cwy", 1, false);
    System.out.println("从redis取得的修改后的值是" + redisTemplate.get("cwy"));
  }
}
